var gulp = require('gulp'),
    autoprefixer = require('gulp-autoprefixer'),
    browsersync = require('browser-sync');
gulp.task('styles', function () {
    gulp.src('./public/stylesheet/new_theme.css')
        .pipe(autoprefixer({
            browsers: ['last 2 versions', 'Android >= 3.0','last 1 Chrome versions','last 3 Safari versions','iOS 7'],
            cascade: true, //是否美化属性值 默认：true 像这样：
            //-webkit-transform: rotate(45deg);
            //        transform: rotate(45deg);
            remove:false //是否去掉不必要的前缀 默认：true
        }))
        .pipe(gulp.dest('dist/assets/css'));
});
gulp.task('auto', function () {
    gulp.watch('public/stylesheet/new_theme.css', ['styles']);
    var files = [
        './public/*.html',
        './public/stylesheet/*.css',
        './public/stylesheet/*.less',
        './public/image/*.jpg',
        './public/image/*.png',
        './public/javascript/*.js',
        './public/lib/*.js'
    ];
    browsersync.init(files, {
        server: {
            baseDir: './public'
        }
    })
});
gulp.task('default', ['auto']);